<template>
  <div id="box">
    <div class="box">{{name}}</div>
  </div>
</template>

<style>
#box {
  position: fixed;
  width: 100%;
  height: 100%;
  background-size: 100% 100%;
  background-image: url("https://shopstatic.vivo.com.cn/vivoshop/commodity/20170421/20170421091321785328_original.jpg");
}
</style>


<script>
export default {
  data() {
    return {
      name: "3"
    };
  },
  created() {
    var _this = this;
    var time = 3;
    var timer = setInterval(function() {
      if (time > 0) {
        time = time - 1;
        _this.name = time;
      } else if (time == 0) {
        _this.$router.push({
          path: "index"
        });
        clearInterval(timer);
      }
    }, 1000);
  }
};
</script>

<style>
.box {
  color: #ffffff;
  border: 2px solid #ffff;
  width: 1rem;
  height: 1rem;
  line-height: 1rem;
  text-align: center;
  border-radius: 50%;
  font-size: 0.6rem;
  float: right;
  margin: 0.3rem;
}
</style>

